# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python-aiowmi
_pkgname=${pkgname#python-}
pkgver=0.2.3
pkgrel=3
pkgdesc='Python Windows Management Interface (WMI) queries connector using asyncio.'
arch=('any')
# https://github.com/cesbit/aiowmi
url='https://pypi.org/project/aiowmi/#files'
license=('GPL-3.0-or-later')
depends=('python' 'python-pycryptodome')
makedepends=('python-build' 'python-installer' 'python-setuptools'
             'python-wheel')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('7608d352a50b99816545109b4ac87888683a8ea45ddb40d5b01072afa22ca70216e5a36281545f745e8945c0cf46117c72dcd86c233e76fdaf11c5b2f29a8df6')

build() {
  cd "$_pkgname-$pkgver"

  python -m build --wheel --no-isolation
}

package() {
  cd "$_pkgname-$pkgver"

  python -m installer --destdir="$pkgdir" dist/*.whl

  find "$pkgdir" -type f -iname '*.pyc' -exec rm {} \;
}

